package day06;


//冒泡排序
public class MaxOfArray {
    public static void main(String[] args) {
        int[] arr = new int[10];
        for (int i = 0; i <arr.length ; i++) {
            arr[i] = (int)(Math.random()*100);
            System.out.println(arr[i]);
        }

        for (int i = 0; i <arr.length ; i++) {
            for (int j = 1; j <arr.length-i; j++) {
                if (arr[j-1]>arr[j]){
                    int temp = arr[j-1];
                    arr[j-1] = arr[j];
                    arr[j] = temp;
                }
            }

        }
        for (int i = 0; i <arr.length; i++) {
            System.out.print(arr[i]+"  ");

        }
    }
}

